package com.jic.market.controller.manage;

import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.market.entity.DiscountPromotionDetail;
import com.jic.market.service.DiscountPromotionDetailService;
import com.jic.order.request.OrderNoPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/discountPromotionDetail")
@Api(tags = {"商品折扣优惠"})
@Slf4j
public class DiscountPromotionDetailController {
    @Resource
    private DiscountPromotionDetailService service;

    /**
     * 分页查询
     * @return
     */
    @PostMapping("/queryPage")
    @ResponseBody
    @ApiOperation(value = "分页查询")
    public PageResult<DiscountPromotionDetail> queryPage(@RequestBody OrderNoPage orderNoPage){
        DiscountPromotionDetail discountPromotionDetail = new DiscountPromotionDetail();
        discountPromotionDetail.setOrderNo(orderNoPage.getOrderNo());
        Page page = new Page();
        page.setLimit(orderNoPage.getLimit());
        page.setStart(orderNoPage.getStart());
        return service.queryPage(discountPromotionDetail,page);
    }

}
